[SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_2033 - #58219
Open
dkling-it wants to merge 1 commit into
Open
[SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_2033#58219dkling-it wants to merge 1 commit into
dkling-it wants to merge 1 commit into
Conversation
Rename _LEGACY_ERROR_TEMP_2033 to UNABLE_TO_CREATE_DATABASE. It's raised by QueryExecutionErrors.unableToCreateDatabaseAsFailedToCreateDirectoryError when InMemoryCatalog.createDatabase can't create the database's backing directory. SQLSTATE 58030 matches other filesystem I/O failures such as FAILED_CREATE_CHECKPOINT_DIRECTORY and UNABLE_TO_FETCH_HIVE_TABLES. Message text and parameters stay the same. Added a checkError test in InMemoryCatalogSuite that triggers the error by pointing createDatabase at a location nested under an existing file. JIRA ticket pending; will fill in the SPARK-XXXXX id before merge.
dkling-it
force-pushed
the
name-legacy-error-2033
branch
from
August 22, 2026 07:56
79dbba8 to
9b396be
Compare
nchammas
reviewed
Aug 23, 2026
nchammas
left a comment
Contributor
There was a problem hiding this comment.
Thanks for working on this. Took a quick look. Will take a closer look during the week.
I think you need to create a sub-task on SPARK-37935 and use that new ticket number in the PR title.
| dbDefinition: CatalogDatabase, e: IOException): Throwable = { | ||
| new SparkException( | ||
| errorClass = "_LEGACY_ERROR_TEMP_2033", | ||
| errorClass = "UNABLE_TO_CREATE_DATABASE", |
Contributor
There was a problem hiding this comment.
This error condition is more general than the actual failure path here. Why not UNABLE_TO_CREATE_DATABASE_DIRECTORY?
(Unfortunately, the code still uses "error class" in many places to refer to what is correctly called an "error condition".)
uros-b
reviewed
Aug 24, 2026
uros-b
left a comment
Member
There was a problem hiding this comment.
@dkling-it Pleaes file a Jira ID for this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Renames
_LEGACY_ERROR_TEMP_2033toUNABLE_TO_CREATE_DATABASE. It's raised byQueryExecutionErrors.unableToCreateDatabaseAsFailedToCreateDirectoryErrorwhenInMemoryCatalog.createDatabasecan't create the database's backing directory. SQLSTATE58030follows the same convention as other filesystem I/O failures such asFAILED_CREATE_CHECKPOINT_DIRECTORYandUNABLE_TO_FETCH_HIVE_TABLES. Message text and parameters are unchanged.Why are the changes needed?
Part of the SPARK-37935 effort to replace
_LEGACY_ERROR_TEMP_*placeholders with proper error conditions.Does this PR introduce any user-facing change?
Yes. The error condition name changes from
_LEGACY_ERROR_TEMP_2033toUNABLE_TO_CREATE_DATABASEand now carries SQLSTATE58030. The rendered message is unchanged.How was this patch tested?
Added a
checkErrortest inInMemoryCatalogSuitethat pointscreateDatabaseat a location nested under an existing regular file, so directory creation fails and the new condition fires. RanInMemoryCatalogSuiteandSparkThrowableSuitelocally; both pass.Was this patch authored or co-authored using generative AI tooling?
No.